import { Component, OnInit } from '@angular/core';

@Component({
    selector: 'app-pipe-fun',
    templateUrl: './pipe-fun.component.html',
    styleUrls: ['./pipe-fun.component.less']
})
export class PipeFunComponent implements OnInit {
    user = {
        name: "tom",
        age: 23
    };
    arr = [1, 2, 3];
    arrObj = [
        { a: 1, b: 2 },
        { a: 1, b: 2 },
        { a: 1, b: 2 }
    ]

    num1 = 123456.9876543;
    num2 = 1.1;
    num3 = 0.98765;

    day = new Date();
    dayStr = "2019/12/25 17:25:1";

    stus = {
        a: 60,
        b: 40,
        c: 80,
        d: 50
    }
    reg = /,/g;
    constructor() { }

    ngOnInit() {
    }
    sortFun(a,b){
        console.log("sortFun:",a,b);
        return a.value - b.value;
    }

}
